package org.example.misc.model;

import org.hibernate.annotations.Type;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
import java.time.LocalDateTime;


@Embeddable
public class CommonEntity implements Serializable {
    private static final long serialVersionUID = 8789348648601290898L;

    @Column(columnDefinition = "varchar(1000) comment '备注'")
    private String remark;
    //
    @Column(name = "enabled", columnDefinition = "char(1) default 'T'", insertable = false)
    @Type(type = "true_false")
    private Boolean enabled ;

    @Column
    private String creator;

    @CreatedDate
    @Column(updatable = false)
    private LocalDateTime createdTime;

    @Column
    private String updater;

    @LastModifiedDate
    private LocalDateTime updatedTime;

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }
}
